package priv.pattern.decorator.subclass;

import priv.pattern.decorator.Coffee;

/*
 * 作者：m鹏h
 * 时间；2024/6/25 21:49
 * 描述：给普通的原味咖啡添加牛奶
 **/
public class MilkCoffee extends CoffeeDecorator {
 public MilkCoffee(Coffee coffeeToDecorate) {
  super(coffeeToDecorate);
 }

 @Override
 public double getCost() {
  return decoratedCoffee.getCost() + 0.5;
 }

 @Override
 public String getIngredients() {
  return decoratedCoffee.getIngredients() + ", 牛奶";
 }
}
